//
//  DDAnnotationView.m
//  MapLink
//
//  Created by Satish Kumar on 5/29/11.
//  Copyright 2011 ISS. All rights reserved.
//


#import "MeetingPlaceAnnotationView.h"
#import "MeetingPlaceAnnotation.h"


@implementation MeetingPlaceAnnotationView

@synthesize mapView;

+ (id)annotationViewWithAnnotation:(id <MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier mapView:(MKMapView *)mapView {
	
		// draggingSupport is feature introduced in iOS 3.2 hence check it before proceeding. If not supported, return nil.
	
	BOOL draggingSupport = ([[[UIDevice currentDevice] systemVersion] compare:@"4.0" options:NSNumericSearch] != NSOrderedAscending);
	
	if (draggingSupport) {
		MKPinAnnotationView *annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
		[annotationView performSelector:NSSelectorFromString(@"setDraggable:") withObject:[NSNumber numberWithBool:YES]];
		annotationView.canShowCallout = YES;
		return [annotationView autorelease];
	} 
		
	return nil;
}

- (void)dealloc {
	[super dealloc];
}

@end